<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>方法</title>
</head>
<body>
  <div id="app">
    <input type="text" v-model="firstname">
    <input type="text" v-model="lastname">
    {{ fullname }}
  </div>
</body>
<script src="vue.js"></script>
<script>
  new Vue({
    el: '#app',
    data: {
      firstname: 'wu',
      lastname: 'daxun'
    },
    computed: {
      fullname () {
        return this.firstname + this.lastname
      }
    }
  })
</script>
</html>